package com.office.meeting.invited.circumstance.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.office.meeting.invited.circumstance.domain.Codition;
import com.office.meeting.invited.circumstance.service.ICoditionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.office.common.annotation.Log;
import com.office.common.core.controller.BaseController;
import com.office.common.enums.BusinessType;
import com.office.common.utils.poi.ExcelUtil;
import com.office.common.core.page.TableDataInfo;

/**
 * 会议情况Controller
 * 
 * @author 柒月
 * @date 2025-05-23
 */
@RestController
@RequestMapping("/condition/ours")
public class CoditionController extends BaseController
{
    @Autowired
    private ICoditionService coditionService;

    /**
     * 查询会议情况列表
     */
    @GetMapping("/list")
    public TableDataInfo list(Codition codition)
    {
        startPage();
        List<Codition> list = coditionService.selectCoditionList(codition);
        return getDataTable(list);
    }

    /**
     * 导出会议列表
     */
    @Log(title = "会议", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Codition codition)
    {
        List<Codition> list = coditionService.selectCoditionList(codition);
        ExcelUtil<Codition> util = new ExcelUtil<Codition>(Codition.class);
        util.exportExcel(response, list, "会议数据");
    }
}
